import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import index from '@/components/index'
import updateUser from '@/components/updateUser'
import userIndex from '@/components/user/userIndex'
import userOperation from '@/components/user/userOperation'
import suppliersIndex from '@/components/suppliers/suppliersIndex'
import suppliersOperation from '@/components/suppliers/suppliersOperation'
import storageIndex from '@/components/storage/storageIndex'
import storageOperation from '@/components/storage/storageOperation'
import inventoryIndex from '@/components/inventory/inventoryIndex'
import inventoryOperation from '@/components/inventory/inventoryOperation'
import goodsIndex from '@/components/goods/goodsIndex'
import goodsOperation from '@/components/goods/goodsOperation'
import saleIndex from '@/components/sale/saleIndex'
import powerOperation from '@/components/user/powerOperation'

Vue.use(Router)

export default new Router({
  mode:"history",
  routes: [
    {
      path: '/',
      name: 'Login',
      meta:{"isLogin":true},
      component: Login
    },
    {
      path: '/index',
      name: 'index',
      component: index,
      children:[
        {
          path: 'updateUser',
          name: 'updateUser',
          component: updateUser
        },
        {
          path: 'userIndex',
          name: 'userIndex',
          component: userIndex
        },
        {
          path: 'userOperation',
          name: 'userOperation',
          component: userOperation
        },
        {
          path: 'suppliersIndex',
          name: 'suppliersIndex',
          component: suppliersIndex
        },
        {
          path: 'suppliersOperation',
          name: 'suppliersOperation',
          component: suppliersOperation
        },
        {
          path: 'storageIndex',
          name: 'storageIndex',
          component: storageIndex
        },
        {
          path: 'storageOperation',
          name: 'storageOperation',
          component: storageOperation
        },
        {
          path: 'inventoryIndex',
          name: 'inventoryIndex',
          component: inventoryIndex
        },
        {
          path: 'inventoryOperation',
          name: 'inventoryOperation',
          component: inventoryOperation
        },
        {
          path: 'goodsIndex',
          name: 'goodsIndex',
          component: goodsIndex
        },
        {
          path: 'goodsOperation',
          name: 'goodsOperation',
          component: goodsOperation
        },
        {
          path: 'saleIndex',
          name: 'saleIndex',
          component: saleIndex
        },
        {
          path: 'powerOperation',
          name: 'powerOperation',
          component: powerOperation
        },
      ],
    },
  ]
})
